package com.zb.CheckLogin;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.ResultSet;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

import freemarker.template.utility.Constants;

public class CheckLogin extends AbstractInterceptor {

	@Override
	public String intercept(ActionInvocation invocation) throws Exception {
		  
        Object isLoged=ActionContext.getContext().getSession().get("user");
  
        if (isLoged != null) {  
            return invocation.invoke();  
        }    
		
		return Action.LOGIN;
	}

	
}
